package mySemantic;

import bit.minisys.minicc.parser.ast.ASTCompilationUnit;
import bit.minisys.minicc.semantic.IMiniCCSemantic;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.File;

public class MySemantic implements IMiniCCSemantic {

    @Override
    public String run(String iFile) throws Exception {
        ObjectMapper mapper =new ObjectMapper();
        ASTCompilationUnit program=(ASTCompilationUnit) mapper.readValue(new File(iFile), ASTCompilationUnit.class);
        System.out.println("in Semantic");

		/*String[] dummyStrs = new String[16];
		TreeViewer viewr = new TreeViewer(Arrays.asList(dummyStrs), program);*/

        MyASTVisitor visitor = new MyASTVisitor();
        visitor.visit(program);

        System.out.println(program.children);


        return null;
    }
}
